package com.disgnpattern.learn.chapter8.simple;

import com.disgnpattern.learn.chapter8.Leifeng;

/**
 * @author dxy
 * @version 1.0
 * @date 2021/10/22 16:18
 * @decripton 简单雷锋工厂
 * @mail victorydeng@163.com
 */
public class LeifengFactory {
    Leifeng create(String type) {
        if ("大学生".equals(type)) {
            return new Undergraduate();
        } else if ("志愿者".equals(type)) {
            return new Volunteer();
        }
        return null;
    }
}
